package com.tiger.cloud.enums;

import com.tiger.cloud.common.mybatis.handler.CodeEnum;

/**
 * 通用枚举类型
 */
public enum ResourceTypeEnum implements CodeEnum<ResourceTypeEnum> {

    CRM_MATCH(0, "CRM用户匹配-->好友申请"), QR_CODE(1, "扫码"), ADDRESSBOOK(2, "手机通讯录"),PEER_CIRCLE(3, "同行圈"),AREA_RECOMMAND(4, "区域人脉");
	
	private int code;
	private String desc;
	

	/**
     * 通过枚举<code>name</code>获取枚举
     */
    public static ResourceTypeEnum getEnumByCode(Integer code) {
    	if(code==null){
    		return null;
    	}
        for (ResourceTypeEnum enumm : ResourceTypeEnum.values()) {
            if (enumm.getCode()==code.intValue()) {
                return enumm;
            }
        }
        return null;
    }
	
	private ResourceTypeEnum(int code, String desc) {
		this.code = code;
		this.desc=desc;
	}

	@Override
	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

}
